/*
*	Ivan Concua 12352
*	Roberto Andrino 12413
*	Algoritmos y estructuras de datos
*	Probabilidades.java
*	
*/
package lab7;
//decide en que parte del arbol es cada cosa es decir una hoja o nodo
/**
 *
 * 
 */
public class NodoHuffman implements Comparable<NodoHuffman> {
        public char ch;
        public int freq;
        public NodoHuffman left, right;

        NodoHuffman(char ch, int freq, NodoHuffman left, NodoHuffman right) {
            this.ch    = ch;
            this.freq  = freq;
            this.left  = left;
            this.right = right;
        }

       

        // compare, based on frequency
        public int compareTo(NodoHuffman that) {
            return this.freq - that.freq;
        }
        
        
        
        
        
        
         // is the node a leaf node?
        public boolean isLeaf() {
            assert (left == null && right == null) || (left != null && right != null);
            return (left == null && right == null);
        }
    }
